<?php

namespace Controller\Advertising;

class Lists extends \Controller\Base {

    public function actionIndex() {
        $this->setMenuPath('Advertising', 'Lists');
        $pager = new \Lib\Core\Pager();
        $pager->pageSize = 20;
        $pager->currentPage = $this->getInt('page', 1);
        $advertising = \Data\Advertising::instance()->getAllAdvertising($pager);
        $advertisingPosition = \Data\Advertising::instance()->getAdvertisingPosition();//广告位置
        foreach($advertising as $key => $val) {
            $advertising[$key]['Position'] = $advertisingPosition[$val['Type']];
        }
        $this->assign('advertising', $advertising);
        $this->assign('pager', $pager);
        $this->display();
    }

}